#ifndef __HIKARI_CollResponseColliderAnimator___FILE__DEFINED
#define __HIKARI_CollResponseColliderAnimator___FILE__DEFINED

#include "hikari.h"

class CollResponseColliderAnimator:public BaseHikariScript{
public:
//PLEASE DO NOT MODIFY THIS SECTION
//PROPERTIES_SECTION_START
//PROPERTIES_SECTION_END
	virtual void sceneLoaded(HObj*object, HikariContext*context){
		IMetaTriangleSelector*metaSelector=(IMetaTriangleSelector*)context->getProperty(L"metaSelector");
		if(metaSelector==NULL){
			metaSelector=context->getSceneManager()->createMetaTriangleSelector();
			context->setProperty(L"metaSelector", metaSelector);
		}
		scene::ISceneNodeAnimator* anim = context->getSceneManager()->createCollisionResponseAnimator(
			metaSelector, 
			object->getInternalNode(),
			object->getInternalNode()->getTransformedBoundingBox().getExtent());
		object->getInternalNode()->addAnimator(anim);
		anim->drop();
	}
	//virtual void sceneUnloading(HObj*object, HikariContext*context){}
	virtual void update(HObj*object, HikariContext*context){
	};
    
	IMPLEMENT_RTTI(CollResponseColliderAnimator, BaseHikariScript);
};
BEGIN_REFLECTION_METADATA(CollResponseColliderAnimator, base_rtti_object)
END_REFLECTION_METADATA(CollResponseColliderAnimator)
#endif